<?php

namespace app\index\controller;

use app\BaseController;
use app\index\service\QueryHtml;

class Index extends BaseController
{
    public function index()
    {
        $uid = session('uid');
        dump($uid);
        dump(session('uname'));
        $str = <<<EOF
        <div class="main">
            <span><a href="/index/Email/list">邮箱列表</a></span>
            <span><a href="/index/User/add">用户添加</a></span>
        </div>
        EOF;
        return $str;
        // return \think\facade\App::version();
    }

    public function hello($name = 'ThinkPHP8')
    {
        return 'hello,' . $name;
    }

    public function error()
    {
        return 'access denied';
    }

    public function getHtml(QueryHtml $q)
    {
        $q->getContentFromQuery();
    }

    public function listData()
    {
        $data = \think\facade\Db::name('right')->select();
        $res = r_sort($data, 0, 0);
        dump($res);
    }

}
